package com.lyz.dataStructure.algorithm.tengxun2020;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 21:52
 * @Description:
 **/

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/8/17 21:52
 *@Description:
 **/
import java.util.Scanner;
import java.util.Stack;

/**
 * @author 786107529@qq.com FJL
 * @Date 2019/8/17 19:59
 */
public class Main3 {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] buildings = new int[n];
        for(int i=0;i<n;i++){
            buildings[i] = sc.nextInt();
        }
        int[] look = look(buildings);
        for(int k=0;k<look.length;k++){
            System.out.print(look[k]+" ");
        }

    }
    public static int[] look(int[] arr){
        int[] res = new int[arr.length];
        for(int i=0;i<arr.length;i++){
            int count = 0;
            int lmax=0;
            int rmax=0;
            int lmax1 = 0;
            int rmax1 = 0;
            int lmid = i;
            int rmid = arr.length-1;
            while (lmid>=0){
                if(arr[lmid]>lmax){
                    lmax = arr[lmid];
                    lmax1 = lmid;
                    lmid--;
                }else {
                    lmid--;
                }
            }
            if(lmax1==i&&i!=0){
                count +=i-lmax1+2;
            }else {
                count +=i-lmax1+1;
            }

            while (rmid>i){
                if(arr[rmid]>rmax){
                    rmax = arr[rmid];
                    rmax1 = rmid;
                    rmid--;
                }else {
                    rmid--;
                }
            }
            if(rmax1==0&&i==arr.length-1){
                res[i] = count;
                continue;
            }else {
                count +=rmax1-i;
            }

            res[i] = count;
        }
        return res;
    }
}
